﻿
Namespace AboutDNN.DNNMVC

    Public Class ActionResult

        Public Enum ActionTypeEnum
            View
            Literal
            Json
        End Enum

        Dim _type As ActionTypeEnum
        Dim _data
        Dim _viewPath As String
        Dim _routeInfo As RouteInfo

        Sub New(ByVal data As Object, ByVal type As ActionTypeEnum)
            _type = type
            _data = data
        End Sub

        Sub New(ByVal data As Object, ByVal type As ActionTypeEnum, ByVal viewRouteInfo As RouteInfo)
            _type = type
            _data = data
            _routeInfo = viewRouteInfo
        End Sub

        Public ReadOnly Property Data() As Object
            Get
                Return _data
            End Get
        End Property

        Public ReadOnly Property Type() As ActionTypeEnum
            Get
                Return _type
            End Get
        End Property

        Public ReadOnly Property ViewPath() As String
            Get
                Return RouteHelper.ControlPath(_routeInfo.Controller, _routeInfo.Action)
            End Get
        End Property

        Public ReadOnly Property RouteInfo As RouteInfo
            Get
                Return _routeInfo
            End Get
        End Property


    End Class

End Namespace
